package cn.amaake.magicplugin.satoken.web;

import cn.dev33.satoken.context.SaHolder;
import cn.dev33.satoken.oauth2.logic.SaOAuth2Handle;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
//import org.ssssssss.magicapi.core.config.MagicConfiguration;
//import org.ssssssss.magicapi.core.web.MagicController;
//import org.ssssssss.magicapi.core.web.MagicExceptionHandler;

/**
 * Sa-OAuth2 Server端 控制器
 */
@RestController
public class SaOAuth2ServerController /*extends MagicController implements MagicExceptionHandler*/ {



//
//    public SaOAuth2ServerController(MagicConfiguration configuration) {
//        super(configuration);
//    }

    // 处理所有OAuth相关请求
    @RequestMapping("/oauth2/*")
    public Object request() {
        System.out.println("------- 进入请求: " + SaHolder.getRequest().getUrl());
        return SaOAuth2Handle.serverRequest();
    }




}
